﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;

namespace IRC.Utilities
{
    public class Logger
    {
        protected static readonly ILog log = LogManager.GetLogger("IRC");
        private static Logger instance;

        private Logger() 
        {
            log4net.Config.XmlConfigurator.Configure();
        }

        public static Logger Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new Logger();
                }
                return instance;
            }
        }

        public bool Verbose { get; set; }

        public void Debug(string message)
        {
            if (this.Verbose)
            {
                log.Debug(message);
            }
        }

        public void Error(string message)
        {
            log.Error(message);
        }

        public void Info(string message)
        {
            log.Info(message);
        }

        public void Fatal(string message)
        {
            log.Fatal(message);
        }

        public void Warn(string message)
        {
            log.Warn(message);
        }
    }
}
